import React from 'react'

export class Payload extends React.Component {
  constructor() {
    super()
    this.state = {
      arr: [
        {
          id: 1,
          name: '小花'
        },
        {
          id: 2,
          name: '小明'
        }]

    }
  }
  handleClick = (e, item) => {
    console.log(e, item);
  }
  render() {
    return (
      <>
        {this.state.arr.map((item) => (
          <div key={item.id}>
            <div>{item.name}</div>
            <button onClick={(e) => this.handleClick(e, item)}>删除</button>
          </div>
        ))}
      </>
    )
  }
}